import subprocess
result=subprocess.run(['ping','-n','3','8.8.8.8'],stdout=subprocess.PIPE)
#result.stdout
print(result.stdout)
print(result.stdout.decode('gbk'))

print(type(result.stdout))
print(type(result.stdout.decode('cp936')))

result_p=subprocess.run(['ping','-n','3','8.8.8.8'],stdout=subprocess.PIPE,encoding='gbk')
print(type(result_p))
print(result_p.stdout)
print(result_p.stdout)